package com.battle.service.controller.web;

import com.battle.pojo.param.unmount.*;
import com.battle.pojo.vo.unmount.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
 * web/战例上下架操作
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/unmount/web")
public class UnmountWebController {

    private final UnmountService service;

    public UnmountWebController(UnmountService service) {
        this.service = service;
    }


    /**
     * 创建战例上下架操作
     *
     * @param param
     * @return
     */
    @PostMapping("/createUnmount")
    public ApiResult createUnmount(@RequestBody @Valid CreateUnmountParam param) {
        service.createUnmount(param);
        return ApiResult.ok();
    }

    /**
     * 获取战例上下架操作列表
     *
     * @param param
     * @return
     */
    @PostMapping("/getUnmountList")
    public ApiResult<PageResult<GetUnmountListVo>> getUnmountList(@RequestBody GetUnmountListParam param) {
        PageResult<GetUnmountListVo> result = service.getUnmountList(param);
        return ApiResult.ok(result);
    }


}

